<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>APR (Airport Rhapsody): monAirportRhapsodyIDS.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">APR (Airport Rhapsody)
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">Implementation based on monitors</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('mon_airport_rhapsody_i_d_s_8h.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">monAirportRhapsodyIDS.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Problem name: Airport rhapsody.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stdbool.h&gt;</code><br/>
<code>#include &lt;pthread.h&gt;</code><br/>
<code>#include &quot;<a class="el" href="prob_const_8h_source.html">probConst.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="prob_data_struct_8h_source.html">probDataStruct.h</a>&quot;</code><br/>
</div>
<p><a href="mon_airport_rhapsody_i_d_s_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a3f23a26ab7b91dbd8909ea4fcb722fa1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mon_airport_rhapsody_i_d_s_8h.html#a3f23a26ab7b91dbd8909ea4fcb722fa1">initialization</a> (void)</td></tr>
<tr class="memdesc:a3f23a26ab7b91dbd8909ea4fcb722fa1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Internal monitor operation.  <a href="#a3f23a26ab7b91dbd8909ea4fcb722fa1">More...</a><br/></td></tr>
<tr class="separator:a3f23a26ab7b91dbd8909ea4fcb722fa1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a8c4d1866f41222e1610f6c93b83cfb6b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8c4d1866f41222e1610f6c93b83cfb6b"></a>
<a class="el" href="struct_f_u_l_l___s_t_a_t.html">FULL_STAT</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mon_airport_rhapsody_i_d_s_8h.html#a8c4d1866f41222e1610f6c93b83cfb6b">fSt</a></td></tr>
<tr class="memdesc:a8c4d1866f41222e1610f6c93b83cfb6b"><td class="mdescLeft">&#160;</td><td class="mdescRight">full state of the problem <br/></td></tr>
<tr class="separator:a8c4d1866f41222e1610f6c93b83cfb6b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa2ec045adddc96dc776ef0468a35e419"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa2ec045adddc96dc776ef0468a35e419"></a>
pthread_cond_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mon_airport_rhapsody_i_d_s_8h.html#aa2ec045adddc96dc776ef0468a35e419">waitingFlight</a></td></tr>
<tr class="memdesc:aa2ec045adddc96dc776ef0468a35e419"><td class="mdescLeft">&#160;</td><td class="mdescRight">porter waiting for work synchronization point <br/></td></tr>
<tr class="separator:aa2ec045adddc96dc776ef0468a35e419"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a59b0587fa51d400b1a66b3e77eb09b77"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a59b0587fa51d400b1a66b3e77eb09b77"></a>
unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mon_airport_rhapsody_i_d_s_8h.html#a59b0587fa51d400b1a66b3e77eb09b77">nPassP</a></td></tr>
<tr class="memdesc:a59b0587fa51d400b1a66b3e77eb09b77"><td class="mdescLeft">&#160;</td><td class="mdescRight">number of passengers who have executed the operation whatShouldIDo in each plane landing <br/></td></tr>
<tr class="separator:a59b0587fa51d400b1a66b3e77eb09b77"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9caccc2ae3353847c05dda074b14e94d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9caccc2ae3353847c05dda074b14e94d"></a>
pthread_cond_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mon_airport_rhapsody_i_d_s_8h.html#a9caccc2ae3353847c05dda074b14e94d">pass</a> [<a class="el" href="prob_const_8h.html#a0240ac851181b84ac374872dc5434ee4">N</a>]</td></tr>
<tr class="memdesc:a9caccc2ae3353847c05dda074b14e94d"><td class="mdescLeft">&#160;</td><td class="mdescRight">passengers synchronization point (one per passenger) <br/></td></tr>
<tr class="separator:a9caccc2ae3353847c05dda074b14e94d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a91d71dab616bc8e53fe27721896a6d9c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a91d71dab616bc8e53fe27721896a6d9c"></a>
unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mon_airport_rhapsody_i_d_s_8h.html#a91d71dab616bc8e53fe27721896a6d9c">nCalls</a> [<a class="el" href="prob_const_8h.html#a0240ac851181b84ac374872dc5434ee4">N</a>]</td></tr>
<tr class="memdesc:a91d71dab616bc8e53fe27721896a6d9c"><td class="mdescLeft">&#160;</td><td class="mdescRight">array of the number of calls made by the porter / bus driver to each passenger <br/></td></tr>
<tr class="separator:a91d71dab616bc8e53fe27721896a6d9c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad2c553ce930c4e05a6b0b50b8664a148"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad2c553ce930c4e05a6b0b50b8664a148"></a>
pthread_cond_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mon_airport_rhapsody_i_d_s_8h.html#ad2c553ce930c4e05a6b0b50b8664a148">waitingDrive</a></td></tr>
<tr class="memdesc:ad2c553ce930c4e05a6b0b50b8664a148"><td class="mdescLeft">&#160;</td><td class="mdescRight">bus driver waiting for starting a new journey synchronization point <br/></td></tr>
<tr class="separator:ad2c553ce930c4e05a6b0b50b8664a148"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac28ca5964614c6b2782bdbbacfcd8f08"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac28ca5964614c6b2782bdbbacfcd8f08"></a>
pthread_cond_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mon_airport_rhapsody_i_d_s_8h.html#ac28ca5964614c6b2782bdbbacfcd8f08">waitingPass</a></td></tr>
<tr class="memdesc:ac28ca5964614c6b2782bdbbacfcd8f08"><td class="mdescLeft">&#160;</td><td class="mdescRight">bus driver waiting for passengers to board / unboard synchronization point <br/></td></tr>
<tr class="separator:ac28ca5964614c6b2782bdbbacfcd8f08"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ae9f9a92da98bb500c590d19d5879fe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1ae9f9a92da98bb500c590d19d5879fe"></a>
unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mon_airport_rhapsody_i_d_s_8h.html#a1ae9f9a92da98bb500c590d19d5879fe">nPassD</a></td></tr>
<tr class="memdesc:a1ae9f9a92da98bb500c590d19d5879fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">number of passengers who have executed either the operation enterTheBus or leaveTheBus in each bus transfer <br/></td></tr>
<tr class="separator:a1ae9f9a92da98bb500c590d19d5879fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab519bbcebc979c03ca54eb9f62d078e9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab519bbcebc979c03ca54eb9f62d078e9"></a>
pthread_mutex_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mon_airport_rhapsody_i_d_s_8h.html#ab519bbcebc979c03ca54eb9f62d078e9">accessCR</a></td></tr>
<tr class="memdesc:ab519bbcebc979c03ca54eb9f62d078e9"><td class="mdescLeft">&#160;</td><td class="mdescRight">locking flag which warrants mutual exclusion inside the monitor <br/></td></tr>
<tr class="separator:ab519bbcebc979c03ca54eb9f62d078e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae4074f8fe97dfa1eb4385e6c60f465c1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae4074f8fe97dfa1eb4385e6c60f465c1"></a>
pthread_once_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="mon_airport_rhapsody_i_d_s_8h.html#ae4074f8fe97dfa1eb4385e6c60f465c1">init</a></td></tr>
<tr class="memdesc:ae4074f8fe97dfa1eb4385e6c60f465c1"><td class="mdescLeft">&#160;</td><td class="mdescRight">flag which warrants internal data is initialized exactly once <br/></td></tr>
<tr class="separator:ae4074f8fe97dfa1eb4385e6c60f465c1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Problem name: Airport rhapsody. </p>
<p>(interface file)</p>
<p>Concept: António Rui Borges</p>
<p>Synchronization based on monitors. Both threads and the monitor are implemented using the pthread library which enables the creation of a monitor of the Lampson / Redell type.</p>
<p>In order the students be able to develop and test separately the operations carried out by the porter, the passengers and the bus driver, the internal data structure is also made visible.</p>
<p>Definition of monitor internal data structure.</p>
<dl class="section author"><dt>Author</dt><dd>António Rui Borges - December 2013 </dd></dl>
</div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a3f23a26ab7b91dbd8909ea4fcb722fa1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void initialization </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Internal monitor operation. </p>
<p>Initialization of the internal data structure that contains the shared information and of the logging file. </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="mon_airport_rhapsody_i_d_s_8h.html">monAirportRhapsodyIDS.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.3.1 </li>
  </ul>
</div>
</body>
</html>
